﻿using System;
using System.Collections.ObjectModel;
using Trading.IBApi;

namespace Trading.Studio
{
    public class LegViewModel : ViewModel 
    {
        public virtual double Multiplier { get; set; }
        public virtual ActionSide Side { get; set; }
        public virtual double Price { get; set; }
        public virtual string PriceType { get; set; }
        public virtual OptionRight Right { get; set; }

        public static LegViewModel Create(ActionSide side, OptionRight right)
        {
            var result = ViewModel.Create<LegViewModel>();
            result.Multiplier = 1;
            result.Side = side;
            result.Right = right;
            result.PriceType = "ask";
            return result;
        }
    }

    public class MainWindowViewModel : ViewModel
    {
        public virtual string Underlying { get; set; }
        public virtual DateTime Expiration { get; set; }
        public virtual double Strike { get; set; }
        public virtual ObservableCollection<LegViewModel> Legs { get; set; }

        double _amountToEnter;
        public virtual double AmountToEnter { get { return _amountToEnter; } set { _amountToEnter = value; } }
        //public virtual double AmountToEnter { get; set; }
        public virtual double StopLossLimit { get; set; }
        public virtual double ProfitTakingLimit { get; set; }

        public virtual string Error { get; set; }
        public virtual string Title { get; set; }
    }
}